<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			/*for(var i=0;i<5;i++){
											setTimeout(function(){
												console.log(i);
											},1000)
										}
										console.log(i)
										}*/
			/*for(var i = 0; i < 5; i++) {
				setTimeout(() => {
					console.log(i);
				}, 1000)

			}
			console.log(i)
			*/
			
			for(let i = 0; i < 5; i++) {
				setTimeout(()=> {
					console.log(i);
				}, 1000)
			}
			console.log(i)
		</script>
	</body>

</html>